Skip to content

HDDS-14356. Support OM Service Framework#10346

Merged
ivandika3 merged 2 commits into
apache:masterfrom
ivandika3:HDDS-14356
Jun 5, 2026
Merged

HDDS-14356. Support OM Service Framework#10346
ivandika3 merged 2 commits into
apache:masterfrom
ivandika3:HDDS-14356

Conversation

@ivandika3

@ivandika3 ivandika3 commented May 23, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Similar to SCM service framework, support OM service framework that can be notified of leader changed. OM stateful service framework can be implemented when needed in HDDS-14790

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-14356

How was this patch tested?

UT (https://github.com/ivandika3/ozone/actions/runs/26270725846)

Generated-by: Codex (GPT-5.5)
@ivandika3 ivandika3 marked this pull request as ready for review May 23, 2026 07:25
@ivandika3 ivandika3 requested review from ChenSammi and xichen01 May 23, 2026 07:25

@peterxcli peterxcli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM +1, I thought we need this few days ago when I reviewing the event notification design: #8871 (comment)

@ivandika3

ivandika3 commented May 23, 2026

Copy link
Copy Markdown
Contributor Author

@peterxcli Good to know that there are more use cases.

The background is that @xichen01 requested to add this to support lifecycle service. We already supported this internally for our own use cases.

@ivandika3 ivandika3 self-assigned this May 24, 2026
@peterxcli

Copy link
Copy Markdown
Member

Thanks @ivandika3 for the info.

The background is that @xichen01 requested to add this to support lifecycle service. We already supported this internally for our own use cases.

Curious is the main use case to have lifecycle service get notified of leader changes?

IMO all background services in OM should eventually migrate to derive from this framework.

image

@ivandika3

Copy link
Copy Markdown
Contributor Author

Curious is the main use case to have lifecycle service get notified of leader changes?

I'm not entirely sure. I was told there was some discussion about lifecycle service that requires some OM service requirement.

IMO all background services in OM should eventually migrate to derive from this framework.

Yes, technically a single background service that only runs on OM leader is ideal. However, IIRC there was some tickets about running background service in follower.

However, I think the background service consistency correctness need to be revisited in the future.

*/
public synchronized void start() {
for (OMService service : services) {
LOG.debug("Stopping service:{}.", service.getServiceName());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stopping -> Starting

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, updated.

if (omRatisSnapshotProvider != null) {
omRatisSnapshotProvider.close();
}
serviceManager.stop();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not an issue, but it's interesting to found that both ServiceManager.starts are implemented but never called.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we can make both ServiceManagers to call start if needed in the future. Currently, each SCMService#start is called manually.

@ChenSammi

Copy link
Copy Markdown
Contributor

Thanks @ivandika3 for working on this. Overall looks good to me.

@ivandika3 ivandika3 merged commit 459f353 into apache:master Jun 5, 2026
90 of 91 checks passed
@ivandika3

Copy link
Copy Markdown
Contributor Author

Thanks @peterxcli @ChenSammi for the reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants